/**
 *   D12    D11    D10
 *nLED_4 nLED_2 nLED_1
 *  GPF6   GPF5   GPF4
 *GPFCON 0x56000050
 *GPFDAT 0x56000054
 *GPFUP  0x56000058
 *
 *GPFCON = 0x00001500:ALL
 *GPFCON = 0x00000100:GPF4
 *GPFCON = 0x00000400:GPF5
 *GPFCON = 0x00001000:GPF6
 */

#define GPFCON (*(volatile unsigned long *)0xA0000050)
#define GPFDAT (*(volatile unsigned long *)0xA0000054)

static inline void wait(unsigned long dly)
{
	for (; dly > 0; dly --);
}

int main(void)
{
	unsigned long i = 0;

	GPFCON = 0x00001500;
	GPFDAT = 0x00000070;

	while (1) {
		wait(300000);
		GPFDAT = (~(i<<4));
		if (++ i == 8)
			i = 0;
	}

	return 0;
}
